package com.lantosec.hmrp.modules.system.entity;

import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.SysCustomReportVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 自定义报表查询表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysCustomReport extends BaseEntity<SysCustomReportVO> {

    private static final long serialVersionUID = 1L;
    public SysCustomReport(SysCustomReportVO vo){
        this.id = vo.getId();
        this.reportName = vo.getReportName();
        this.reportDesc = vo.getReportDesc();
        this.reportSource = vo.getReportSource();
        this.reportLayout = vo.getReportLayout();
        this.reportCondition = vo.getReportCondition();
        this.pagination = vo.getPagination();
        this.enable = vo.getEnable();
        this.export = vo.getExport();
        this.createTime = vo.getCreateTime();
    }

    @Override
    public SysCustomReportVO convertToVO(){
        return new SysCustomReportVO(this);
    }


    /**
     * 主键Id
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 报表名称
     */
    private String reportName;

    /**
     * 报表描述
     */
    private String reportDesc;

    /**
     * 报表数据源
     */
    private String reportSource;

    /**
     * 报表布局
     */
    private String reportLayout;

    /**
     * 报表条件
     */
    private String reportCondition;

    /**
     * 是否分页，0 不分页，1 分页
     */
    private Integer pagination;

    /**
     * 是否启用，0 不启用，1 启用
     */
    private Integer enable;

    /**
     * 是否导出，0 不导出，1 导出
     */
    private Integer export;

    /**
     * 创建时间
     */
    private Date createTime;


    public enum ColName {
        id, report_name, report_desc, report_source, report_layout, report_condition, pagination, enable, export, create_time,
    }
}
